function peakInterval = FUN_heartRateCalcHistory(fig,data )

[peaks,index] = findpeaks(data,'MinPeakDistance',50);
peakInterval = diff(index)/100;
figure(fig);clf();
hist(peakInterval); 
grid on;
title('Filtered Data Peak Histogram  Analysis');axis auto;
xlabel('Time/s'); ylabel('Num/Value');

AverageDistance_Peaks = mean(peakInterval);
heart_rate_his = 60/(AverageDistance_Peaks)

end
